﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace FashionWebsite.Models.DAL
{
    public class DalCategory
    {

        ShopOnlineDataContext data = new ShopOnlineDataContext();
        public List<Category> category { get; set; }
        public List<Category> getListProductCategory()
        {
            return (from c in data.Categories select c ).ToList();
        }
        public IEnumerable<Category> getCategory(int? id)
        {
            return (from c in data.Categories where c.CategoryParent == id select c);
        }

        public string ItemId { get; set; }
        public List<Comment> Comments { get; set; }
        public IEnumerable<Category> getListparent()
        {
            return (from c in data.Categories where c.CategoryParent == null select c ).ToList();
        }
    }
}